package com.company.tree.binarytree;

/**
 * @author shenhan
 * @create 2020/2/3 12:29
 * @description
 */
public class BinaryTreeDemo {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        HeroNode root = new HeroNode(1, "松江");
        HeroNode node2 = new HeroNode(2, "闵行");
        HeroNode node3 = new HeroNode(3, "闸北");
        HeroNode node4 = new HeroNode(4, "普陀");
        HeroNode node5 = new HeroNode(5, "宝山");
        binaryTree.setRoot(root);
        root.setLeft(node2);
        root.setRight(node3);
        node3.setRight(node4);
        node3.setLeft(node5);
        System.out.println(binaryTree.preOrderSearch(5));
        System.out.println(binaryTree.infixOrderSearch(5));
        System.out.println(binaryTree.postOrderSearch(5));
/*        binaryTree.preOrder();
        System.out.println("---------");
        binaryTree.infixOrder();
        System.out.println("---------");
        binaryTree.postOrder();*/
    }
}
